//
//  NSDictionary_Tests.m
//  NSDictionary_Tests
//
//  Created by 唐可雄 on 16/9/23.
//  Copyright © 2016年 swustyc. All rights reserved.
//

#import <XCTest/XCTest.h>

#import "NSDictionary+Null.h"

@interface NSDictionary_Tests : XCTestCase

@property (nonatomic, strong) NSDictionary *dic;

@end

@implementation NSDictionary_Tests

- (void)setUp {
    [super setUp];
    // Put setup code here. This method is called before the invocation of each test method in the class.
    self.dic = @{@"key1":[NSNull null],
                 @"key2":@"value2"};
}

- (void)tearDown {
    self.dic = nil;
    // Put teardown code here. This method is called after the invocation of each test method in the class.
    [super tearDown];
}

- (void)testExample {
    // This is an example of a functional test case.
    // Use XCTAssert and related functions to verify your tests produce the correct results.
    
    id value1 = [self.dic valueDefaultNilForKey:@"key1"];
    id value2 = [self.dic valueForKey:@"key2"];
    
    XCTAssertEqual(value1, nil, @"正确");
    XCTAssertNotEqual(value2, nil, @"错误");
}

- (void)testPerformanceExample {
    // This is an example of a performance test case.
    [self measureBlock:^{
        // Put the code you want to measure the time of here.
    }];
}

@end
